#ifndef __NormalTollgateLayer_H__
#define __NormalTollgateLayer_H__

#include "cocos2d.h"
#include "entity/Entity/Entity.h"
#include "scene/NormalTollgateScene/StarManager/StarManager.h"
#include "scene/NormalTollgateScene/RocketManager/RocketManager.h"

USING_NS_CC;

class NormalTollgateLayer : public CCLayer{
public:
	NormalTollgateLayer();
	~NormalTollgateLayer();

	CREATE_FUNC(NormalTollgateLayer);
	virtual bool init();

	virtual void onEnter();
	virtual void onExit();

	//virtual void onExit();

private:
	void loadBackGroundAndStar(int bgMoveLayer);

	void setRolling(int curY);

	void bgMove(CCObject* pData);

	void checkDetectionCrash(float dt);

	void detectionCrash();

	void createcountDownAnimation();

	void callbackUpdate();

private:
	int m_curLevel;

	StarManager* m_starManager[2];

	RocketManager* m_rocketManager;

	int m_curBg;

	CCSprite* m_bgSpritr[2];

	int m_maxLayer;

	CCSprite* m_countDownSprite;
};
#endif // !__NormalTollgateLayer_H__
